package whf.framework.meta.dao;

import java.util.List;

import whf.framework.exception.FindException;
import whf.framework.meta.entity.Object;

/**
 * @author wanghaifeng
 * @email king@126.com
 * @modify 2006-05-31
 */
public class ObjectDAOImp extends whf.framework.dao.DAOImp<Object> implements ObjectDAO {
	/* (non-Javadoc)
	 * @see whf.framework.meta.dao.ObjectDAO#findByBoClass(java.lang.String)
	 */
	public Object findByEntityClass(String cls) throws FindException {
		List<Object> list = super.findWithoutLazy("t.boClassName = ? ", cls);
		return list.isEmpty()?null: list.get(0);
	}

	/* (non-Javadoc)
	 * @see whf.framework.meta.dao.ObjectDAO#findByTableName(java.lang.String)
	 */
	public Object findByTableName(String tableName) throws FindException{
		List<Object> list = super.findWithoutLazy("t.persistenceTable=?", tableName);
		return list.isEmpty()?null: list.get(0);
	}
} 